<!-- Main -->
<div class="page-header">
  <h2 class="text-center">Liste des brocantes du jour géolocalisées</h2>
  <h3 class="text-center">dans un rayon de 15 km</h3>
</div>
</div>

<div class="container">

<div class="row featurette">
  <div class="col-md-4">

      <!--<div class="well" style="text-align:center">
        <form class="form-horizontal">
          <legend class="the-legend">Filter le contenu</legend>
          <div class="container">
            <div class='col-md-3'>
              <div class="form-group">
                <label for="select" class="control-label">Date de la brocante :</label><br><br>
                <div class='input-group date' id='datetimepicker1'>
                  <input type='text' class="form-control" />
                  <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
                </span>
              </div><br><br>
              <button type="submit" class="btn btn-primary" disabled="disabled">Filtrer</button>
            </div>
          </div>
        </div>-->
          <!--<fieldset>
            <legend>Filtre de recherche</legend>
            <div class="form-group">
              <label for="select" class="control-label">Date de la brocante :</label><br><br>
              <div class='input-group date' id='datetimepicker1'>
                <input type='text' class="form-control" />
                <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
              </span>
            </div><br><br>
            <button type="submit" class="btn btn-primary">Filtrer</button>  
          </div>-->
        </form>
      </div>
    </div>


    <div class="col-md-12 blog-main">
      <?php if (isset($brocantes[0])){ foreach ($brocantes as $k => $v): ?>
      <div class="blog-post">
        <h2><?php echo $v->nom.' - '; ?><span class="text-muted"><?php echo $v->lieu ?></span></h2>
        <h4><span class="text-muted"><?php echo strftime('%A, %e %B %Y', strtotime($v->dateBroc)) ?></span></h4>
        <p><?php echo substr(strip_tags(trim($v->description), '<b><br>'), 0, 300).' ...'; ?></p>
        <p><a class="btn btn-primary btn-default" role="button" href="<?php echo Router::url("brocantes/view/{$v->id}/$v->slug"); ?>">Voir les détails &raquo;</a></p>

      </div>
      <hr class="featurette-divider">

    <?php endforeach; }else{echo "<div class='jumbotron' style='text-align:center'><span style='font-size:4em' class='glyphicon glyphicon-eye-close'></span><h3>Pas de résultat</h3></div>";} ?>

    <div>
      <ul class="pagination" style="">
        <?php for ($i=1; $i <= $page; $i++): ?>
        <li <?php if($i==$this->request->page) echo 'class="active"'; ?>><a href="?page=<?php echo $i ?>"><?php echo $i ?></a></li>
      <?php endfor; ?>
    </ul>
  </div>
</div>
<script type="text/javascript">
$(function () {
  $('#inputdateBroc').datetimepicker({ language: 'fr'});
});
</script>